/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.persistence.core;

import com.blandware.atleap.common.util.PartialCollection;
import com.blandware.atleap.common.util.QueryInfo;
import com.blandware.atleap.model.core.ContentImage;
import com.blandware.atleap.model.core.ResourceData;
import com.blandware.atleap.persistence.exception.DeleteException;

/**
 * <p>DAO for content image</p>
 * <p><a href="ContentImageDAO.java.html"><i>View Source</i></a></p>
 *
 * @author Sergey Zubtsovskiy <a href="mailto:sergey.zubtsovskiy@blandware.com">&lt;sergey.zubtsovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.5 $ $Date: 2006/08/03 10:07:36 $
 */
public interface ContentImageDAO extends ContentResourceDAO {

	// ~ CRUD Methods ================================================================

	/**
	 * Creates new content image
	 *
	 * @param contentImage Object that represents what image must be created
	 * @param resourceData resource data that holds image data
	 * @return ID of created content image
	 */
	public Long createContentImage(ContentImage contentImage, ResourceData resourceData);

	/**
	 * Retrieves content image with specified ID
	 *
	 * @param contentImageId ID to search by
	 * @return Content image or null if no content image with specified ID exists in database
	 */
	public ContentImage retrieveContentImage(Long contentImageId);

	/**
	 * Updates content image
	 *
	 * @param contentImage Image to update
	 * @param resourceData resource data that holds image data
	 */
	public void updateContentImage(ContentImage contentImage, ResourceData resourceData);

	/**
	 * Deletes content image
	 *
	 * @param contentImage Image to delete
	 * @throws com.blandware.atleap.persistence.exception.DeleteException
	 *          if content image cannot be deleted
	 */
	public void deleteContentImage(ContentImage contentImage) throws DeleteException;

	// ~ Additional methods ================================================================

	/**
	 * Retrieves filtered/sorted collection of content images.
	 *
	 * @param queryInfo Object that contains information about how to filter and sort data
	 * @return Collection of images
	 */
	public PartialCollection listContentImages(QueryInfo queryInfo);

	
	// ~ Finders ================================================================

	/**
	 * Finds content image by URI
	 *
	 * @param uri URI of image to search by
	 * @return Content image or null if nothing was found
	 */
	public ContentImage findContentImageByUri(String uri);


}
